// OKR子任务进展
var childrenColumns = [{
    id: 'zhouqi',
    title: '周期',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'guishu',
    title: '项目归属部门',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'leixing',
    title: '项目类型',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'proname',
    title: '项目名称',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'fuze',
    title: '负责人',
    width: 60,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'mubiao',
    title: '阶段目标',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'renwu',
    title: '标准任务',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'chengguo',
    title: '关键成果',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'planTime',
    title: '计划完成时间',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'kr',
    title: 'KR权重',
    width: 62,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'user',
    title: '成员',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 't100',
    title: '投入百分比',
    width: 88,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'krover',
    title: 'KR完成率',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'e100',
    title: '实际投入百分比',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'domsg',
    title: '子任务进展',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'nextmsg',
    title: '下一步计划',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'krp',
    title: 'KR得分',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'op',
    title: 'O得分',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'time',
    title: '更新时间',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'operation',
    title: '操作',
    width: 80,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="rechildren(' + record.id + ');"><i class="icon-refresh"></i>  更新</button>';
      return content;
    }
  }
];
var childrenOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR子任务进展',
  datas: [{
    id: 1,
    zhouqi: 'Q1',
    guishu: '销售部门',
    leixing: '销售项目',
    proname: '项目名称测试数据',
    fuze: '张三',
    mubiao: '阶段目标测试',
    renwu: '标准任务测试',
    chengguo: '关键成果测试',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    krover: '20%',
    e100: '34%',
    domsg: '子任务进展测试数据',
    nextmsg: '下一步计划测试数据',
    krp: '20分',
    op: '30分',
    time: '2018-06-10',
  }, {
    id: 2,
    zhouqi: 'Q1',
    guishu: '销售部门',
    leixing: '销售项目',
    proname: '项目名称测试数据',
    fuze: '张三',
    mubiao: '阶段目标测试',
    renwu: '标准任务测试',
    chengguo: '关键成果测试',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    krover: '20%',
    e100: '34%',
    domsg: '子任务进展测试数据',
    nextmsg: '下一步计划测试数据',
    krp: '20分',
    op: '30分',
    time: '2018-06-10',
  }, {
    id: 3,
    zhouqi: 'Q1',
    guishu: '销售部门',
    leixing: '销售项目',
    proname: '项目名称测试数据',
    fuze: '张三',
    mubiao: '阶段目标测试',
    renwu: '标准任务测试',
    chengguo: '关键成果测试',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    krover: '20%',
    e100: '34%',
    domsg: '子任务进展测试数据',
    nextmsg: '下一步计划测试数据',
    krp: '20分',
    op: '30分',
    time: '2018-06-10',
  }, ],
  columns: childrenColumns,
  gridContainer: 'childrenContainer',
  toolbarContainer: 'childrenToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childrenGrid = $.fn.dlshouwen.grid.init(childrenOption);
$(function () {
  childrenGrid.load();
});
// 子任务数据更新
function rechildren(id) {
  location.href = './edit/edit-progress.html';
}
// 子任务自评得分
var childColumns = [{
    id: 'zhouqi',
    title: '周期',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'guishu',
    title: '项目归属部门',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'leixing',
    title: '项目类型',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'proname',
    title: '项目名称',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'fuze',
    title: '负责人',
    width: 60,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'mubiao',
    title: '阶段目标',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'renwu',
    title: '标准任务',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'chengguo',
    title: '关键成果',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'planTime',
    title: '计划完成时间',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'kr',
    title: 'KR权重',
    width: 62,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'user',
    title: '成员',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 't100',
    title: '投入百分比',
    width: 88,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'f1',
    title: '积极性',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f2',
    title: '沟通能力',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f3',
    title: '团队协作性',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f4',
    title: '创新力',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f5',
    title: '承诺性',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f6',
    title: '抗压力',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f7',
    title: '执行力',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f8',
    title: '责任心',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f9',
    title: '劳动态度',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f10',
    title: '总得分',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  },
  {
    id: 'operation',
    title: '操作',
    width: 130,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="editChild(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
      return content;
    }
  }
];
var childOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '子任务自评得分',
  datas: [{
    zhouqi: 'Q1',
    guishu: '销售部门',
    leixing: '销售项目',
    proname: '项目名称测试数据',
    fuze: '张三',
    mubiao: '阶段目标测试',
    renwu: '标准任务测试',
    chengguo: '关键成果测试',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    f1: '10分',
    f2: '10分',
    f3: '10分',
    f4: '10分',
    f5: '10分',
    f6: '10分',
    f7: '10分',
    f8: '10分',
    f9: '10分',
    f10: '100分',
  }, ],
  columns: childColumns,
  gridContainer: 'childContainer',
  toolbarContainer: 'childToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childGrid = $.fn.dlshouwen.grid.init(childOption);
$(function () {
  childGrid.load();
});
// 子任务自评更新
function editChild(id) {
  location.href = './edit/edit-child.html';
}
// OKR子任务评分
var childsColumns = [{
    id: 'zhouqi',
    title: '周期',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'guishu',
    title: '项目归属部门',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'leixing',
    title: '项目类型',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'proname',
    title: '项目名称',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'fuze',
    title: '负责人',
    width: 60,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'mubiao',
    title: '阶段目标',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'renwu',
    title: '标准任务',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'chengguo',
    title: '关键成果',
    type: 'string',

    columnClass: 'text-left',
  }, {
    id: 'planTime',
    title: '计划完成时间',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'kr',
    title: 'KR权重',
    width: 62,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'user',
    title: '成员',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 't100',
    title: '投入百分比',
    width: 88,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'f1',
    title: '积极性',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f2',
    title: '沟通能力',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f3',
    title: '团队协作性',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f4',
    title: '创新力',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f5',
    title: '承诺性',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f6',
    title: '抗压力',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f7',
    title: '执行力',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f8',
    title: '责任心',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f9',
    title: '劳动态度',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'f10',
    title: '总得分',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'operation',
    title: '操作',
    width: 130,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="editChilds(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
      return content;
    }
  }
];
var childsOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR子任务评分',
  datas: [{
    zhouqi: 'Q1',
    guishu: '销售部门',
    leixing: '销售项目',
    proname: '项目名称测试数据',
    fuze: '张三',
    mubiao: '阶段目标测试',
    renwu: '标准任务测试',
    chengguo: '关键成果测试',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    f1: '10分',
    f2: '10分',
    f3: '10分',
    f4: '10分',
    f5: '10分',
    f6: '10分',
    f7: '10分',
    f8: '10分',
    f9: '10分',
    f10: '100分',
  }, ],
  columns: childsColumns,
  gridContainer: 'childsContainer',
  toolbarContainer: 'childsToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childsGrid = $.fn.dlshouwen.grid.init(childsOption);
$(function () {
  childsGrid.load();
});
// 子任务评分更新
function editChilds(id) {
  location.href = './edit/edit-childs.html';
}

// OKR负责人自评
var childbColumns = [{
    id: 'zhouqi',
    title: '周期',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'guishu',
    title: '项目归属部门',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'leixing',
    title: '项目类型',
    width: 50,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'proname',
    title: '项目名称',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'fuze',
    title: '负责人',
    width: 60,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'f0',
    title: '领导力',
    width: 60,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'f1',
    title: '积极性',
    width: 60,
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'f2',
    title: '沟通能力',
    width: 50,
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'f3',
    title: '团队协作性',
    width: 88,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'f4',
    title: '创新力',
    width: 60,
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'f5',
    title: '承诺性',
    width: 60,
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'f6',
    title: '抗压力',
    width: 60,
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'f7',
    title: '执行力',
    width: 60,
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'f8',
    title: '责任心',
    width: 60,
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'f9',
    title: '劳动态度',
    width: 50,
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'f10',
    title: '总得分',
    type: 'string',
    columnClass: 'text-center',

  }, {
    id: 'operation',
    title: '操作',
    width: 130,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="editChildb(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
      return content;
    }
  }
];
var childbOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR负责人自评',
  datas: [{
    zhouqi: 'Q1',
    guishu: '销售部门',
    leixing: '销售项目',
    proname: '项目名称',
    fuze: '张三',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    f0: '10分',
    f1: '10分',
    f2: '10分',
    f3: '10分',
    f4: '10分',
    f5: '10分',
    f6: '10分',
    f7: '10分',
    f8: '10分',
    f9: '10分',
    f10: '110分',
  }, ],
  columns: childbColumns,
  gridContainer: 'childbContainer',
  toolbarContainer: 'childbToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childbGrid = $.fn.dlshouwen.grid.init(childbOption);
$(function () {
  childbGrid.load();
});

// OKR项目负责人自评更新
function editChildb(id) {
  location.href = './edit/edit-childb.html';
}

// 待列入OKR项目
var cproColumns = [{
  id: 'proname',
  title: '项目名称',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'mycos',
  title: '我的角色',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'pronow',
  title: '项目当前进展',
  type: 'string',
  columnClass: 'text-left',
}, ];
var cproOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '待列入OKR项目',
  datas: [{
    id: 1,
    proname: '项目名称测试数据',
    mycos: '我的角色测试数据',
    pronow: '项目当前进展测试数据',
  }, ],
  columns: cproColumns,
  gridContainer: 'cproContainer',
  toolbarContainer: 'cproToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var cproGrid = $.fn.dlshouwen.grid.init(cproOption);
$(function () {
  cproGrid.load();
});

//子任务进展更新记录
var cplogColumns = [{
    id: 'zhouqi',
    title: '周期',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'guishu',
    title: '项目归属部门',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'leixing',
    title: '项目类型',
    width: 50,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'proname',
    title: '项目名称',
    width: 73,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'fuze',
    title: '负责人',
    width: 60,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'mubiao',
    title: '阶段目标',
    type: 'string',
    columnClass: 'text-left',
  }, {
    id: 'renwu',
    title: '标准任务',
    type: 'string',
    columnClass: 'text-left',
  }, {
    id: 'chengguo',
    title: '关键成果',
    type: 'string',
    columnClass: 'text-left',
  }, {
    id: 'planTime',
    title: '计划完成时间',
    width: 101,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'kr',
    title: 'KR权重',
    width: 62,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'user',
    title: '成员',
    width: 45,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 't100',
    title: '投入百分比',
    width: 88,
    type: 'string',
    columnClass: 'text-center',
  }, {
    id: 'krover',
    title: 'KR完成率',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'e100',
    title: '实际投入百分比',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'domsg',
    title: '子任务进展',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'nextmsg',
    title: '下一步计划',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'krp',
    title: 'KR得分',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'op',
    title: 'O得分',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  }, {
    id: 'time',
    title: '更新时间',
    type: 'string',
    columnClass: 'text-center',
    hideType: 'xs|sm|md|lg',
  },
];
var cplogOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR子任务进展',
  datas: [{
    id: 1,
    zhouqi: 'Q1',
    guishu: '销售部门',
    leixing: '销售项目',
    proname: '项目名称测试数据',
    fuze: '张三',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    krover: '20%',
    e100: '34%',
    domsg: '子任务进展测试数据',
    nextmsg: '下一步计划测试数据',
    krp: '20分',
    op: '30分',
    time: '2018-06-10',
  }, ],
  columns: cplogColumns,
  gridContainer: 'cplogContainer',
  toolbarContainer: 'cplogToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var cplogGrid = $.fn.dlshouwen.grid.init(cplogOption);
$(function () {
  cplogGrid.load();
});